package cn.itcast.bos.service.base.impl;

import cn.itcast.bos.dao.base.AreaRepository;
import cn.itcast.bos.domain.base.Area;
import cn.itcast.bos.service.base.AreaService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;

/**
 * Created by xbqco on 2018/7/13.
 */
@Service
@Transactional
public class AreaServiceImpl implements AreaService {
    @Autowired
    AreaRepository areaRepository;
    @Override
    public Page<Area> findPage(Specification spec,Pageable pageable) {

        return areaRepository.findAll( spec, pageable);
    }

    @Override
    public List<Area> findAll() {
        return areaRepository.findAll();
    }

    @Override
    public void save(Area area) {
        areaRepository.save(area);
    }

    @Override
    public void save(List<Area> list){
        areaRepository.save(list);
    }
}
